<?
#####################################################
#  COPYRIGHT NOTICE
#####################################################
# In the following statements, the term "this 
# program" refers to all files associated with the
# execution and distribution of Adtrackz.
#
# This Program is Copyright 2004 Jonah Klimack.
# All Rights Reserved. 
#
# Selling the code for this program, modifying 
# and/or redistributing the code for this program
# in part or in whole over the Internet or in any 
# other medium is expressly forbidden. Violators
# will be prosecuted to the fullest extent of the law
# Copyright and header information may not be
# modified.
#
# This program is distributed "as is" and without 
# warranty of any kind, either express or implied.
# In no event shall the liability of Jonah Klimack 
# for any damages, losses and/or causes of 
# action exceed the total amount paid by the 
# user for this software.		
#####################################################
# DO NOT MODIFY ANYTHING IN THIS FILE
#####################################################


require "header.php";
require "submenu.php";
$campaign = mysql_fetch_row(mysql_query("select * from adtrackz_campaigns where ID='$cID'"));
?>


<table width="100%">
<tr>
	<td>
		<p class="small" align="left">Campaigns > <?=$campaign[2]?> > Click History</p>
	</td>
	<td>
		<?load_submenu($cID,$campaign[2])?>
	</td>
</tr>
</table>




<p class="heading">
Statistic History for <?=ucfirst($campaign[2])?>
</p>


<center>
<form action="dstats-history.php" method="post">
<select name="sID">
<?
	if (!$sID)
		echo "<option value=\"\" selected>Campaign: $campaign[2]</option>";
	else
		echo "<option value=\"\">Campaign: $campaign[2]</option>";	

	//get all the subcampaigns, display them, sorted
	$allsubs = mysql_query("select * from adtrackz_subcampaigns where campaignID='$cID' order by adcode asc");	
	while ($allsub = mysql_fetch_row($allsubs))
	{
		if ($sID == $allsub[0])
			echo "<option value=\"$allsub[0]\" selected>subcampaign: $allsub[2]</option>";
		else
			echo "<option value=\"$allsub[0]\">subcampaign: $allsub[2]</option>";
	}
?>
</select>
<input type="hidden" name="allstats" value="yes">
<input type="hidden" name="cID" value="<?=$cID?>">
<input type="submit" name="submit" value="View Summary"  >
</form>
</p>

<?


//include charts.php in your script
include "charts.php";

//NUMBER OF HITS PER DAY THIS MONTH
echo InsertChart ( "charts.swf", "dstats-daily.php?cID=$cID&sID=$sID",500, 300, "ffffff");

echo "<br><br>";
//NUMBER OF HITS PER DAY LAST MONTH
echo InsertChart ( "charts.swf", "dstats-daily2.php?cID=$cID&sID=$sID",500, 300, "ffffff");

echo "<br><br>";
//NUMBER OF HITS BY THE HOURs
echo InsertChart ( "charts.swf", "dstats-hourly.php?cID=$cID&sID=$sID", 500, 300, "ffffff");

echo "<br><br>";
//NUMBER OF HITS SHOWN MONTHLY BY YEAR
echo InsertChart ( "charts.swf", "dstats-monthly.php?cID=$cID&sID=$sID", 500, 300, "ffffff");

echo "<br><br>";
//NUMBER OF HITS YEARLY
echo InsertChart ( "charts.swf", "dstats-yearly.php?cID=$cID&sID=$sID", 500, 300, "ffffff");
echo "</center>";


require "footer.php";

?>
